//
// Created by 束庆乐 on 2025/1/2.
//
#include "iostream"
using namespace std;

class AbstractCalculator{
public:
    int num1;
    int num2;
    virtual int getResult(){return 0;}
};

class Add : public AbstractCalculator{
public:
    int getResult(){
        return num1+num2;
    }
};

class Substra : public  AbstractCalculator{
public:
    int getResult(){
        return num1 - num2;
    }
};

class Multi : public AbstractCalculator{
public:
    int getResult(){
        return num1 * num2;
    }
};

class Div : public AbstractCalculator{
public:
    int getResult(){
        return num1/num2;
    }
};

void test(){
    AbstractCalculator *add = new Add;
    add->num1 = 10;
    add->num2 = 10;
    cout << "add=" << add->getResult() << endl;
    delete add;

    AbstractCalculator *sub = new Substra;
    sub->num1 = 20;
    sub->num2 = 5;
    cout << "sub=" << sub->getResult() << endl;
    delete sub;
}

int main086(){
    test();

    return 0;
}